<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    let hd = `
      <h1>houdunren</h1>
      <span>后盾人</span>
      <h2>hdcms</h2>
    `;
    let reg = /<(h[1-6])>([\s\S]+)<\/\1>/gi;
    // console.log(hd.replace(reg, `<p>$2</p>`));
    let res = hd.replace(reg, (p0, p1, p2) => `<p>${p2}</p>`);
    console.log(res);
  </script>
</html>
